NFS Server
2013/01/17 |
Configure NFS Server to share any directories on your Network.
|
|
[1] | It's the Configuration on the system you want to build NFS server. |
[root@dlp ~]#
yum -y install nfs-utils
[root@dlp ~]#
vi /etc/idmapd.conf # line 5: uncomment and change to your domain name Domain = srv.world
[root@dlp ~]#
vi /etc/exports # write like below *note /home 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash)
# *note /home ⇒ shared directory 10.0.0.0/24 ⇒ range of networks NFS permits accesses rw ⇒ writable sync ⇒ synchronize no_root_squash ⇒ enable root privilege no_all_squash ⇒ enable users' authority
systemctl start rpcbind.service [root@dlp ~]# systemctl start nfs-server.service [root@dlp ~]# systemctl start nfs-lock.service [root@dlp ~]# systemctl start nfs-idmap.service [root@dlp ~]# systemctl enable rpcbind.service [root@dlp ~]# systemctl enable nfs-server.service [root@dlp ~]# systemctl enable nfs-lock.service [root@dlp ~]# systemctl enable nfs-idmap.service |
[2] | Configuration on NFS clients |
[root@www ~]#
yum -y install nfs-utils
[root@www ~]#
vi /etc/idmapd.conf # line 5: uncomment and change to your domain name Domain = srv.world
systemctl start rpcbind.service [root@www ~]# systemctl start nfs-lock.service [root@www ~]# systemctl start nfs-idmap.service [root@www ~]# systemctl start nfs-mountd.service [root@www ~]# systemctl enable rpcbind.service [root@www ~]# systemctl enable nfs-lock.service [root@www ~]# systemctl enable nfs-idmap.service [root@www ~]# systemctl enable nfs-mountd.service [root@www ~]# mount -t nfs dlp.srv.world:/home /home [root@www ~]# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 992M 0 992M 0% /dev tmpfs 1002M 0 1002M 0% /dev/shm tmpfs 1002M 1.5M 1001M 1% /run tmpfs 1002M 0 1002M 0% /sys/fs/cgroup /dev/mapper/fedora-root 16G 1.2G 14G 8% / tmpfs 1002M 0 1002M 0% /tmp /dev/vda1 485M 71M 389M 16% /boot dlp.srv.world:/home 16G 1.2G 14G 8% /home # home directory on NFS is mounted
[root@www ~]#
vi /etc/fstab /dev/mapper/VolGroup-lv_root / ext4 defaults 1 1 UUID=65ec32e2-f459-4d63-b8b0-e18124b50f3a /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 # add at the lat line: change home directory this server mounts to the one on NFS dlp.srv.world:/home /home nfs defaults 0 0 |